# set project's name
PROJECT( TRANSLATOR )
  
SET( TRANSLATOR_SRCS
  translator_main.cpp
  WebBrowser.cpp
  MainWindow.cpp
  MainWindow_slots.cpp
  Bookmarks.cpp
  Translate.cpp
  TextWindow.cpp
  Log.cpp
)
  
SET( TRANSLATOR_MOC_HDRS
  WebBrowser.h
  MainWindow.h
  Translate.h
  TextWindow.h
)
  
# some .ui files
SET( TRANSLATOR_UIS
)
  
# and finally an resource file
SET( TRANSLATOR_RCS
)
  
# enable warnings
# for windows application 
# ADD_DEFINITIONS( /target:winexe )
  
# by default only QtCore and QtGui modules are enabled
# other modules must be enabled like this:
#SET( QT_USE_QT3SUPPORT TRUE )   
#SET( QT_USE_QTXML TRUE )
  
QT4_ADD_RESOURCES( TRANSLATOR_RC_SRCS ${TRANSLATOR_RCS} )
QT4_WRAP_UI( TRANSLATOR_UI_HDRS ${TRANSLATOR_UIS} )
QT4_WRAP_CPP( TRANSLATOR_MOC_SRCS ${TRANSLATOR_MOC_HDRS} )
  
# we need this to be able to include headers produced by uic in our code
# (CMAKE_BINARY_DIR holds a path to the build directory, while INCLUDE_DIRECTORIES() works just like INCLUDEPATH from qmake)
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )
  
ADD_EXECUTABLE( translator ${TRANSLATOR_SRCS} ${TRANSLATOR_MOC_SRCS} ${TRANSLATOR_RC_SRCS} ${TRANSLATOR_UI_HDRS} )
  
# last thing we have to do is to tell CMake what libraries our executable needs,
# luckily FIND_PACKAGE prepared QT_LIBRARIES variable for us:
TARGET_LINK_LIBRARIES( translator ${QT_LIBRARIES} /usr/lib/x86_64-linux-gnu/libQtWebKit.so )

QT4_WRAP_CPP( BTRANS_MOC_SRCS btrans_worker.h)

#ADD_EXECUTABLE( btrans
#  btrans.cc
#  WebBrowser.cpp
#  MainWindow.cpp
# MainWindow_slots.cpp
#  Bookmarks.cpp
#  Translate.cpp
#  TextWindow.cpp
#  Log.cpp
#  ${BTRANS_MOC_SRCS}
#  ${TRANSLATOR_MOC_SRCS}
#)
#TARGET_LINK_LIBRARIES(btrans
#  ${QT_LIBRARIES}
#  ${Boost_LIBRARIES}
#)
